package com.easpeed.comon.database.dao

import android.database.Cursor
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.easpeed.comon.database.bean.CrashBean

@Dao
interface CrashDao {


    @Insert
    fun insert(bean: CrashBean)


    /**
     * 查询日志
     */
    @Query("select * from table_crash t where createTimeMills>=:time order by t.id desc ")
    fun queryCrashList(time: Long): List<CrashBean>?

    /**
     * 查询日志
     */
    @Query("select * from table_crash t order by t.id desc ")
    fun queryCrashAll(): Cursor?

    /**
     * 删除日志
     */
    @Query("Delete  from table_crash where createTimeMills<=:time")
    fun deleteCrash(time: Long): Int


}